<?php

namespace App\Http\Controllers;

use App\Library\Requests\Area\AreaInfoRequest;
use App\Library\Requests\Base\IdRequest;
use App\Library\Service\AreaService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class AreaController extends BaseController
{
    public function __construct(AreaService $service)
    {
        $this->service = $service;
    }

    /**
     *
     * @param AreaInfoRequest $request
     * @return JsonResponse
     *
     */
    public function areaInfo(AreaInfoRequest $request): JsonResponse
    {
        return $this->service->areaInfo($request);
    }

    /**
     * @return JsonResponse
     */
    public function all(): string
    {
        return $this->service->all();
    }
}
